package view;

import java.awt.SystemColor;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

/**
 * @uthor BWH
 */

public class GUI_OpretPatient extends JPanel {
	TeraFootMain teraFootMain;

	private final JTextField txtFornavn;
	private final JTextField txtEfternavn;
	private final JTextField txtCPR;
	private final JTextField txtTlf;
	private final JTextField txtMobil;
	private final JTextField txtAdresse;
	private final JTextField txtBy;
	private final JTextField txtPostnr;
	private final JTextField textEmail;
	private final JTextField textLaegeNavn;
	private final JTextField textLaegeTlf;
	private final JTextField textLaegeAdr;
	private final JTextArea textAreaJournal;
	private final JComboBox comboBox;
	private final JButton btnSearchNow;

	JLabel lblTelefonLaege;
	JLabel lblAdresseLaege;
	JLabel lblNavnLaege;
	JLabel lblSygesikring;
	JLabel lblLge;
	JLabel lblJournal;
	JScrollPane scrollPane;

	String journalTemplate = "Journal dato:\r\n\r\nEventuelle p\u00E5r\u00F8rendes navn /adresse: \r\n"
			+ "\r\nSygdomme: \r\n\r\nMedicin: \r\n\r\nEventuelle gener ved medicinen: \r\n\r\r\nAndet:\r\n";

	JButton btnOpretPatient;
	JButton btnRedigerPat;
	JButton btnAnnuller;
	private final JButton btnAnnuler2;

	/**
	 * Create the panel.
	 */
	public GUI_OpretPatient(TeraFootMain teraFootMain) {
		this.teraFootMain = teraFootMain;

		setBackground(SystemColor.activeCaption);
		setLayout(null);

		txtFornavn = new JTextField();
		txtFornavn.setBounds(115, 38, 108, 20);
		txtFornavn.setToolTipText("Fornavn");
		add(txtFornavn);
		txtFornavn.setColumns(10);

		final JLabel lblFornavn = new JLabel("Fornavn:");
		lblFornavn.setBounds(21, 38, 84, 14);
		add(lblFornavn);

		final JLabel lblEfternavn = new JLabel("Efternavn:");
		lblEfternavn.setBounds(21, 63, 84, 14);
		add(lblEfternavn);

		txtEfternavn = new JTextField();
		txtEfternavn.setBounds(115, 63, 108, 20);
		txtEfternavn.setToolTipText("Efternavn");
		add(txtEfternavn);
		txtEfternavn.setColumns(10);

		final JLabel lblCprnr = new JLabel("CPR-nr:");
		lblCprnr.setBounds(21, 88, 84, 14);
		add(lblCprnr);

		txtCPR = new JTextField();
		txtCPR.setBounds(115, 88, 108, 20);
		txtCPR.setToolTipText("CPR-nr");
		add(txtCPR);
		txtCPR.setColumns(10);

		final JLabel lblTelefonnr = new JLabel("Telefonnr:");
		lblTelefonnr.setBounds(21, 113, 84, 14);
		add(lblTelefonnr);

		final JLabel lblMobiltlf = new JLabel("Mobiltlf:");
		lblMobiltlf.setBounds(21, 138, 84, 14);
		add(lblMobiltlf);

		txtTlf = new JTextField();
		txtTlf.setBounds(115, 113, 108, 20);
		txtTlf.setToolTipText("Telefon nummer");
		add(txtTlf);
		txtTlf.setColumns(10);

		txtMobil = new JTextField();
		txtMobil.setBounds(115, 138, 108, 20);
		txtMobil.setToolTipText("Mobiltlf nummer");
		add(txtMobil);
		txtMobil.setColumns(10);

		final JLabel lblPatientOplysninger = new JLabel("Patient oplysninger");
		lblPatientOplysninger.setBounds(77, 11, 146, 20);
		add(lblPatientOplysninger);

		final JLabel lblAdresse = new JLabel("Adresse:");
		lblAdresse.setBounds(21, 188, 84, 14);
		add(lblAdresse);

		txtAdresse = new JTextField();
		txtAdresse.setBounds(115, 188, 108, 20);
		txtAdresse.setToolTipText("Adresse");
		add(txtAdresse);
		txtAdresse.setColumns(10);

		final JLabel lblBy = new JLabel("By:");
		lblBy.setBounds(21, 213, 84, 14);
		add(lblBy);

		final JLabel lblPostnummer = new JLabel("Postnr:");
		lblPostnummer.setBounds(21, 238, 84, 14);
		add(lblPostnummer);

		txtBy = new JTextField();
		txtBy.setBounds(115, 213, 108, 20);
		txtBy.setToolTipText("By");
		add(txtBy);
		txtBy.setColumns(10);

		txtPostnr = new JTextField();
		txtPostnr.setBounds(115, 238, 108, 20);
		txtPostnr.setToolTipText("Postnummer");
		add(txtPostnr);
		txtPostnr.setColumns(10);

		lblJournal = new JLabel("Journal");
		lblJournal.setBounds(21, 274, 72, 14);
		add(lblJournal);

		scrollPane = new JScrollPane();
		scrollPane.setBounds(21, 299, 629, 190);
		add(scrollPane);

		textAreaJournal = new JTextArea();
		textAreaJournal
				.setText("Journal dato:\r\n\r\nEventuelle p\u00E5r\u00F8rendes navn /adresse: \r\n\r\nSygdomme: \r\n\r\nMedicin: \r\n\r\nEventuelle gener ved medicinen: \r\n\r\r\nAndet:\r\n");
		scrollPane.setViewportView(textAreaJournal);
		textAreaJournal.setLineWrap(true);

		final JLabel lblEmail = new JLabel("Email:");
		lblEmail.setBounds(21, 163, 46, 14);
		add(lblEmail);

		textEmail = new JTextField();
		textEmail.setBounds(115, 162, 108, 20);
		add(textEmail);
		textEmail.setColumns(10);

		lblLge = new JLabel("L\u00E6ge");
		lblLge.setBounds(339, 14, 46, 14);
		add(lblLge);

		lblNavnLaege = new JLabel("Navn:");
		lblNavnLaege.setBounds(257, 38, 72, 14);
		add(lblNavnLaege);

		lblTelefonLaege = new JLabel("Telefon:");
		lblTelefonLaege.setBounds(257, 63, 72, 14);
		add(lblTelefonLaege);

		lblAdresseLaege = new JLabel("Adresse:");
		lblAdresseLaege.setBounds(257, 88, 72, 14);
		add(lblAdresseLaege);

		textLaegeNavn = new JTextField();
		textLaegeNavn.setBounds(339, 38, 108, 20);
		add(textLaegeNavn);
		textLaegeNavn.setColumns(10);

		textLaegeTlf = new JTextField();
		textLaegeTlf.setColumns(10);
		textLaegeTlf.setBounds(339, 63, 108, 20);
		add(textLaegeTlf);

		textLaegeAdr = new JTextField();
		textLaegeAdr.setColumns(10);
		textLaegeAdr.setBounds(339, 88, 108, 20);
		add(textLaegeAdr);

		btnOpretPatient = new JButton("Opret patient");
		btnOpretPatient.setActionCommand("GemPatient");
		btnOpretPatient.addActionListener(teraFootMain.getAcListener());
		btnOpretPatient.setBounds(247, 188, 196, 33);
		add(btnOpretPatient);

		btnAnnuller = new JButton("T\u00F8m alle felter");
		btnAnnuller.setToolTipText("T\u00F8mmer alle felter");
		btnAnnuller.setActionCommand("Anuller");
		btnAnnuller.addActionListener(teraFootMain.getAcListener());
		btnAnnuller.setBounds(247, 229, 196, 33);
		add(btnAnnuller);

		comboBox = new JComboBox();
		comboBox.setToolTipText("Lad der st\u00E5 0, hvis patienten ingen har.");
		comboBox.setModel(new DefaultComboBoxModel(
				new String[] { "0", "1", "2" }));
		comboBox.setBounds(247, 160, 97, 20);
		add(comboBox);

		lblSygesikring = new JLabel("Sygesikring Danmark:");
		lblSygesikring.setBounds(247, 132, 146, 26);
		add(lblSygesikring);

		btnRedigerPat = new JButton("Gem \u00E6ndringer");
		btnRedigerPat.setVisible(false);
		btnRedigerPat.setActionCommand("RedigerPat");
		btnRedigerPat.addActionListener(teraFootMain.getAcListener());
		btnRedigerPat.setBounds(247, 188, 196, 33);
		add(btnRedigerPat);

		btnSearchNow = new JButton("S\u00F8g nu");
		btnSearchNow.setActionCommand("Search Now");
		btnSearchNow.setVisible(false);
		btnSearchNow.addActionListener(teraFootMain.getAcListener());
		btnSearchNow.setBounds(247, 188, 196, 33);
		add(btnSearchNow);

		btnAnnuler2 = new JButton("T\u00F8m alle felter");
		btnAnnuler2.setVisible(false);
		btnAnnuler2.setToolTipText("T\u00F8mmer alle felter");
		btnAnnuler2.setActionCommand("Search patient");
		btnAnnuler2.addActionListener(teraFootMain.getAcListener());
		btnAnnuler2.setBounds(247, 234, 196, 33);
		add(btnAnnuler2);
	}

	public JTextField getTxtFornavn() {
		return txtFornavn;
	}

	public JTextField getTxtEfternavn() {
		return txtEfternavn;
	}

	public JTextField getTxtCPR() {
		return txtCPR;
	}

	public JTextField getTxtTlf() {
		return txtTlf;
	}

	public JTextField getTxtMobil() {
		return txtMobil;
	}

	public JTextField getTxtAdresse() {
		return txtAdresse;
	}

	public JTextField getTxtBy() {
		return txtBy;
	}

	public JTextField getTxtPostnr() {
		return txtPostnr;
	}

	public JTextField getTextEmail() {
		return textEmail;
	}

	public JTextField getTextLaegeNavn() {
		return textLaegeNavn;
	}

	public JTextField getTextLaegeTlf() {
		return textLaegeTlf;
	}

	public JTextField getTextLaegeAdr() {
		return textLaegeAdr;
	}

	public JTextArea getTextAreaJournal() {
		return textAreaJournal;
	}

	public JComboBox getComboBox() {
		return comboBox;
	}

	public JButton getBtnOpretPatient() {
		return btnOpretPatient;
	}

	public JButton getBtnRedigerPat() {
		return btnRedigerPat;
	}

	public JButton getBtnAnnuller() {
		return btnAnnuller;
	}

	public JButton getBtnSearchNow() {
		return btnSearchNow;
	}

	public JButton getBtnAnnuler2() {
		return btnAnnuler2;
	}

	public String getJournalTemplate() {
		return journalTemplate;
	}

	public JLabel getLblTelefonLaege() {
		return lblTelefonLaege;
	}

	public JLabel getLblAdresseLaege() {
		return lblAdresseLaege;
	}

	public JLabel getLblNavnLaege() {
		return lblNavnLaege;
	}

	public JLabel getLblSygesikring() {
		return lblSygesikring;
	}

	public JLabel getLblLge() {
		return lblLge;
	}

	public JLabel getLblJournal() {
		return lblJournal;
	}

	public JScrollPane getScrollPane() {
		return scrollPane;
	}

}
